package com.symone.webcms.service;

import com.symone.webcms.model.ScheduleTask;
import com.baomidou.mybatisplus.service.IService;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.quartz.SchedulerException;

import java.util.Date;
import java.util.List;
/**
 *   @description : ScheduleTask 服务接口
 *   ---------------------------------
 * 	 @author Archer Chu
 *   @since 2019-04-04
 */
public interface ScheduleTaskService extends IService<ScheduleTask> {

        boolean insert(ScheduleTask scheduleTask);

        Page<ScheduleTask> findPage(Page<ScheduleTask> page, Wrapper<ScheduleTask> scheduleTask);

        List<ScheduleTask> findAll();

        int delete(long id);

        boolean deleteFlagById(long id);

        int clear();

        int updateTimeById(Date previousTime, Date nextTime, Long id);

        int updateStatusById(String status, Long id);

        ScheduleTask getJob(String jobName,String jobGroup) throws SchedulerException;

        List<ScheduleTask> getAllJobs() throws SchedulerException;

        List<ScheduleTask> getRunningJob() throws SchedulerException;

        boolean addJob(ScheduleTask task) throws SchedulerException;

        boolean pauseJob(ScheduleTask task);

        boolean resumeJob(ScheduleTask task);

        boolean deleteJob(Long id);

        void startJob(ScheduleTask task) throws SchedulerException;

        void updateCron(ScheduleTask task) throws SchedulerException;

        void updateStartTime(ScheduleTask task) throws SchedulerException;

        boolean batchUpdate(String ids, String status);
}
